<template>
	<view class="charging">
		<view class="bg">

		</view>
		<view class="status_bar">
			<!-- 这里是状态栏 -->
		</view>
		<view class="status_bar">
			<!-- 这里是状态栏 -->
		</view>
		<view class="title">
			<view class="titleitem titleItemLeft">
				<text @click="gobackButton">《</text>
			</view>
			<view class="titleitem">
				充电中
			</view>
			<view class="titleitem">

			</view>

		</view>
		<view class="container">
			<chargingProgress />
			<view class="data">
				<text>
					电压(V):336.4
				</text>
				<text>
					电流(A):45.6
				</text>
				<text>
					功率(Kw):15339.84
				</text>
			</view>
			<view class="count">
				<view class="count_item">
					<text class="count_title">已充电量</text>
					<text class="count_data">{{chargingData.ele}}度</text>
				</view>
				<view class="count_item">
					<text class="count_title">已充时长</text>
					<text class="count_data">{{chargingData.time}}分</text>
				</view>
				<view class="count_item">
					<text class="count_title">电费合计</text>
					<text class="count_data">{{chargingData.price}}元</text>
				</view>
			</view>
			<view class="car_num">
				<view>
					<text>
						车牌号
					</text>
					<text class="num">
						{{carNum}}
					</text>
				</view>
				<navigator url="">
					<text>
						修改
					</text>
				</navigator>
			</view>
			<view class="end_btn">
				<button type="default" @tap="endCharge">结束充电</button>
			</view>
		</view>
	</view>
</template>

<script>
	import chargingProgress from '../../components/charging_progress/charging_progress.vue'
	export default {
		components: {
			chargingProgress
		},
		data() {
			return {
				chargingData: {
					ele: 5.6,
					time: 9.15,
					price: 9.78
				},
				carNum: "川A66666",
				// 充电订单号
				Chargeorder: "",
			}
		},
		onLoad(options) {
			this.Chargeorder = options.Chargeorder;
		},
		methods: {
			gobackButton() {
				uni.navigateBack()
			},
			// 点击结束充电
			endCharge() {
				uni.navigateTo({
					url: `/pages/Charging-details/Charging-details?Chargeorder=${this.Chargeorder}`
				})
			}
		}
	}
</script>

<style lang="scss">
	.status_bar {
		height: var(--status-bar-height);
		width: 100%;
	}

	.charging .bg {
		background-color: #df3447;
		width: 750rpx;
		height: 483rpx;
		position: fixed;
		top: 0;
		z-index: -9999;
	}

	.charging .title {
		text-align: center;
		height: 80rpx;
		padding: 20rpx;
		display: flex;
		color: #ffffff;

		.titleitem {
			flex-grow: 1;
			font-size: 36rpx;
		}

		.titleItemLeft {
			text-align: left;
		}
	}

	.container {
		background-color: #ffffff;
		width: 690rpx;
		/* height: 892rpx; */
		margin: 45rpx auto 0;
		padding-bottom: 100rpx;
	}

	.container .data {
		display: flex;
		justify-content: space-between;
		border-bottom: 1rpx solid #e5e5e5;
		padding-bottom: 40rpx;
		margin-top: 55rpx;
		margin-bottom: 40rpx;
	}

	.data text {
		color: #c1c1c1;
	}

	.container .count {
		display: flex;
		justify-content: space-around;
		padding-bottom: 45rpx;
		border-bottom: 1rpx solid #e5e5e5;
		margin-bottom: 40rpx;
	}

	.count .count_item {
		display: flex;
		flex-direction: column;
	}

	.count .count_title {
		margin-bottom: 30rpx;
		text-align: center;
		color: #a8a8a8;
	}

	.count .count_data {
		text-align: center;
		color: #f16c6c;
	}

	.container .car_num {
		display: flex;
		justify-content: space-between;
		box-sizing: border-box;
		padding: 0 23rpx;
		margin-bottom: 60rpx;
	}

	.car_num .num {
		margin-left: 55rpx;
	}

	.container .end_btn {
		margin-bottom: 100rpx;
	}

	.end_btn button {
		width: 470rpx;
		height: 60rpx;
		color: #ffffff;
		line-height: 60rpx;
		background-color: #ed3a1d;

	}
</style>
